<!--test.vue-->
<template>
  <div class="digital-flop">
    <dv-digital-flop :config="flopConfig" style="height: 100%" />
  </div>
</template>

<script>
import { config } from "./data.js";
console.log(config);
export default {
  name: "DigitalFlop",
  props: {
    config: {
      type: Object,
      default: () => config,
    },
  },
  data() {
    return {
      flopConfig: this.config,
    };
  },
  mounted() {
    let num = 999;
    this.timer = setInterval(() => {
      num += 999;
      this.flopConfig.number = [num];
      console.log(this.flopConfig);
      this.flopConfig = { ...this.flopConfig };
    }, 2000);
  },
  beforeDestroy() {
    this.timer && clearInterval(this.timer);
  },
};
</script>

<style lang="scss" scoped>
.digital-flop {
  display: inline-block;
}
</style>
